/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.baatar.opt.genetic.chromosome;

import java.io.Serializable;


/**
 * Lightweight interface for chromosome objects which will be send through 
 * network for parallel implementations.
 * 
 */
public class MigrantChromosome<T> implements Serializable {
    private int clusterIndex = 0;
    private int optimizerIndex = 0;
    private double fitness = 0.0;
    private T chromosomeData = null;

    public MigrantChromosome(int clusterIndex,
                                int optimizerIndex,
                                double fitness,
                                T data) {
        this.clusterIndex = clusterIndex;
        this.optimizerIndex = optimizerIndex;
        this.fitness = fitness;
        this.chromosomeData = data;
    }

    /**
     * @return the fitness
     */
    public double getFitness() {
        return fitness;
    }

    /**
     * @param fitness the fitness to set
     */
    public void setFitness(double fitness) {
        this.fitness = fitness;
    }

    /**
     * @return the chromosomeData
     */
    public T getChromosomeData() {
        return chromosomeData;
    }

    /**
     * @param chromosomeData the chromosomeData to set
     */
    public void setChromosomeData(T chromosomeData) {
        this.chromosomeData = chromosomeData;
    }

    /**
     * @return the clusterIndex
     */
    public int getClusterIndex() {
        return clusterIndex;
    }

    /**
     * @param clusterIndex the clusterIndex to set
     */
    public void setClusterIndex(int clusterIndex) {
        this.clusterIndex = clusterIndex;
    }

    /**
     * @return the optimizerIndex
     */
    public int getOptimizerIndex() {
        return optimizerIndex;
    }

    /**
     * @param optimizerIndex the optimizerIndex to set
     */
    public void setOptimizerIndex(int optimizerIndex) {
        this.optimizerIndex = optimizerIndex;
    }

}
